#!/bin/bash

cp ./auto-screen.py ${HOME}/auto-screen.py
cp ./auto-screen.local ${HOME}/auto-screen.local
chmod +x ${HOME}/auto-screen.local

mkdir ${HOME}/.config/systemd
mkdir ${HOME}/.config/systemd/user
sudo cp ./auto-screen.service /etc/systemd/user/auto-screen.service
sudo chmod 664 /etc/systemd/user/auto-screen.service

echo "all file copied"

kysec_set -n exectl -v verified ~/auto-screen.py
kysec_set -n exectl -v verified ~/auto-screen.local
sudo systemctl daemon-reload
systemctl --user enable auto-screen
systemctl --user start auto-screen

echo "service enabled, check ~/auto-screen.error for log"

exit

